package models

import (
	"time"
)

// MaGoodsClass [...]
type MaGoodsClass struct {
	ClassID          string    `gorm:"index:ClassID;autoIncrement:true;column:class_id;type:int;not null;comment:类目ID"  json:"class_id" json_old:"ClassID"`
	ID               string    `gorm:"index:ma_goods_ibfk_1;autoIncrement:false;primaryKey;column:id;type:int unsigned;not null;comment:设备权限ID"  json:"id" json_old:"ID"`
	ClassName        string    `gorm:"index:ClassName1;column:class_name;type:varchar(50);not null;comment:类目名称1"  json:"class_name" json_old:"ClassName"`
	ClassDescription string    `gorm:"column:class_description;type:varchar(4095);default:null;comment:类品描述3"  json:"class_description" json_old:"ClassDescription"`
	ClassStatus      uint      `gorm:"column:class_status;type:int unsigned;not null;default:2;comment:商品状态（0-上架 1-缺货 2-下架）"  json:"class_status" json_old:"ClassStutas"`
	AddTime          time.Time `gorm:"column:add_time;type:datetime;default:null;comment:添加时间"  json:"-" json_old:"AddTime"`
	AddTimeFormated  string    `gorm:"-" json:"add_time"`
	TotalSales       int       `gorm:"column:total_sales;type:int(32) unsigned zerofill;not null;default:00000000000000000000000000000000"  json:"total_sales" json_old:"TotalSales"`
	Deleted          int       `gorm:"column:deleted;type:tinyint(1);not null;default:0;comment:软删除 0正常 1删除"  json:"deleted" json_old:"Deleted"`
	MerchantID       string    `gorm:"column:merchant_id;type:varchar(30);not null;comment:商户id" json:"merchant_id" json_old:"ID"`
	CreatedAt        int64     `gorm:"index:created_at;column:created_at;autoCreateTime;type:int;size:64;comment:创建时间" json:"created_at"`
}

// TableName get sql table name.获取数据库表名
func (m MaGoodsClass) TableName() string {
	return "ma_goods_class"
}

// 模式自动注册
func init() {
	Models = append(Models, &MaGoodsClass{})
}
